package com.linkvin.ec.hcs.service.util.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public enum WarehouseTypeEnum {

    // 仓库类型 10:整车仓库 20 配件类 30 耗材类 40 用品类 50 固定资产类
    VECHILEWH("10", "整车仓库"),
    ARMATUREWH("20", "配件仓库"),
    CONSUMABLEWH("30", "耗材仓库"),
    USEWH("40", "用品仓库"),
    ASSETSAWH("50", "固定资产仓库");

    private final String value;
    private final String text;

    private static final Map<String, String> lookup = new HashMap<>();

    static {
        for (WarehouseTypeEnum s : EnumSet.allOf(WarehouseTypeEnum.class)) {
            lookup.put(s.getValue(),s.getText());
        }
    }

    WarehouseTypeEnum(String value, String text) {
        this.value = value;
        this.text = text;
    }


    /**
     * Gets value.
     *
     * @return the value
     */
    public String getValue() {
        return value;
    }

    /**
     * Gets text.
     *
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     *
     * @param value
     * @return
     */
    public static WarehouseTypeEnum getByValue(String value) {
        for (WarehouseTypeEnum temp : WarehouseTypeEnum.values()) {
            if (temp.getValue().equals(value)) {
                return temp;
            }
        }
        return null;
    }

    /***
     * 得到所有的值
     * @return
     */
    public static Map<String, String> lookup() {
        return lookup;
    }

}
